package cn.gengar.domain.activity.model.valobj;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum DiscountTypeEnum {

    BASE(0, "基础优惠"),
    TAG(1, "人群标签");

    private Integer code;
    private String info;


    public static DiscountTypeEnum getByCode(Integer code) {
        for (DiscountTypeEnum discountTypeEnum : values()) {
            if (discountTypeEnum.getCode().equals(code)) {
                return discountTypeEnum;
            }
        }
        throw new RuntimeException("err DiscountTypeEnum code!");
    }
}
